<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p2 = new Promise((resolved,rejected)=>{
            resolved('p2p2p2p2p2p2p2p2p2p2p')
        })
        const p1 = new Promise((resolved,rejected)=>{
            rejected('p1p1p1p1p1p1p1p1p')
            
        })
        //始终返回全部结果，无论是rejected还是resolved
        const res1 = Promise.allSettled([p1,p2])
        console.log(res1)
        //如果有rejected就返回那个，全部是resolved才会全部返回
        const res2 = Promise.all([p1,p2])
        console.log(res2)
    </script>
</body>
</html>